package IO;

import java.io.*;

public class Test {
    public static void main(String[] args) throws IOException {

        File file = new File("test1.txt");
        file.createNewFile();
        System.out.println(file.getAbsolutePath());
        System.out.println(file.getPath());
        FileInputStream fileInputStream = null;
        try {
            fileInputStream = new FileInputStream(file);

            byte[] b = new byte[5];
            int len = 0;
            while ((len = fileInputStream.read(b))!=-1){
                System.out.print(new String(b,0,len));

            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            if (fileInputStream!=null){
                fileInputStream.close();
            }
        }


    }



}
